import data from "./data.mjs";
import ParseArray from "./ParseArray.mjs";

var isArray = function (obj) {
    var arrType = (typeof obj.push + "").toUpperCase();
    if (arrType == "UNDEFINED") {
        return false;
    } else {
        return true;
    }
};



var isObject = function (obj) {
    if (!isArray(obj)) {
        var objType = (typeof obj + "").toUpperCase();
        if (objType == "OBJECT") {
            return true;
        }
    }
    return false;
};

var historyTableName = []; //记录所有的表名称
var historyTableLayer = []; //记录所有的表层级

var lookObject = function (data, layer) {
    for (var key in data) {
        var node = data[key];
        if (isObject(node) || isArray(node)) {
            var parseArray = new ParseArray();
            parseArray.start(node, key + layer);
            lookObject(node, layer++);
        }
    }
};

lookObject(data, 1);
